UBound (array)

Basic and Crystal syntax.

Argument

array is an array value, expression or variable.

Returns

Number value.

Action

UBound returns a Number containing the largest available subscript for the given array.

Typical use

Commonly used to obtain the size of an array before using a looping control mechanism to systematically manipulate elements of the array.

Examples

The following examples are for both Basic and Crystal syntax:

Rem Basic syntax
Dim simpleArray(10) As Number
formula = UBound(simpleArray)

//Crystal syntax
Local NumberVar Array simpleArray;
Redim simpleArray[10];
UBound(simpleArray)

Returns 10.

Rem Basic syntax
Dim dateArray () As Date
dateArray = Array (CDate(#12/25/1998#), CDate(#12/24/1999#))
formula = UBound(dateArray)

//Crystal syntax
Local DateVar Array dateArray;
dateArray := [CDate(#12/25/1998#), CDate(#12/24/1999#)];
UBound (dateArray)

Returns 2.

Comments


Seagate Software, Inc.
http://www.seagatesoftware.com
Please send comments to:
techpubs@seagatesoftware.com